'use strict';

angular.module("app").service('BaseInfoService', ['dbUtils', '$http', '$q', function (dbUtils, $http, $q) {
    return {
        getValidImgCode: function () {
            return "/validcode/img?" + new Date().getTime();
        },
        getStoreTypes: function () {
            return dbUtils.get("/base/type/list");
        },
        getProvinces: function(){
            return dbUtils.get("/base/position/provinces");
        },
        getCities: function(provinceId){
            return dbUtils.post("/base/position/cities",{provinceId:provinceId});
        },
        getAreas: function(cityId){
            return dbUtils.post("/base/position/areas",{cityId:cityId});
        },

        applyInfo:function(data){
            return dbUtils.post("/apply/save",data);
        },

        getDetail:function(){
            return dbUtils.get("/store/detail");
        },
        setDetail:function(data){
            return dbUtils.post("/store/setDetail",data);
        },

        getDelivery:function(){
            return dbUtils.get("/store/delivery");
        }
    }
}]);